<?php

use App\Http\Controllers\Api\AdminController;
use App\Http\Controllers\Api\AggregateController;
use App\Http\Controllers\Api\ApiController;
use App\Http\Controllers\Api\BureauController;
use App\Http\Controllers\Api\DomainAuthController;
use App\Http\Controllers\Api\LocationController;
use App\Http\Controllers\Api\NoteController;
use App\Http\Controllers\Api\PageController;
use App\Http\Controllers\Api\PetsController;
use App\Http\Controllers\Api\SignTaskController;
use App\Http\Controllers\Api\StudentController;
use App\Http\Controllers\Api\ThirdPartyController;
use App\Http\Controllers\Api\UsedController;
use App\Http\Controllers\Api\VoterController;
use App\Http\Controllers\Api\WeChatController;
use App\Wen\Utils\Utils;
use App\Http\Controllers\Api\HelpController;
use App\Http\Controllers\Api\IndexController;
use App\Http\Controllers\Api\LuckDrawController;
use App\Http\Controllers\Api\NotifyController;
use App\Http\Controllers\Api\ShopGoodsController;
use App\Http\Controllers\Api\UserController;
use App\Http\Controllers\Api\PostsController;
use App\Http\Controllers\Api\UploadsController;
use App\Http\Controllers\Api\CircleController;
use App\Http\Controllers\Api\CommonController;
use App\Http\Controllers\Api\CommentController;
use App\Http\Controllers\Api\FeedbackController;
use App\Http\Controllers\Api\MessagesController;
use App\Http\Controllers\Api\TagsController;
use App\Http\Controllers\Api\ChatController;
use App\Http\Controllers\Api\OrderController;
use App\Http\Controllers\Api\ShopController;
use App\Http\Controllers\Api\ShopOrderController;
use App\Http\Controllers\Api\AdminCode\AdminActionsController;
use App\Http\Controllers\Api\AdminCode\AdminCommentController;
use App\Http\Controllers\Api\AdminCode\AdminCommonController;
use App\Http\Controllers\Api\AdminCode\AdminGoodsController;
use App\Http\Controllers\Api\AdminCode\AdminPostsController;
use App\Http\Controllers\Api\WallpaperController;

/**
 * 需要登录
 */
Route::group(
    ['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth.api'], function () {

    //  上传文件
    Route::post('/files/uploads', [UploadsController::class, 'putFile'])->middleware('auth.userstate');
    //  删除附件（仅限图文上传的资源）
    Route::post('/files/del', [UploadsController::class, 'delFile'])->middleware('auth.userstate');
    // cos临时密钥
    Route::post('/files/credentials', [UploadsController::class, 'cos_tmp_credentials'])->middleware('auth.userstate');
    Route::post('/files/callback', [UploadsController::class, 'cos_tmp_callback']);
    //添加圈子
    Route::post('/posts/add/circle', [CommonController::class, 'createCircle'])->middleware('auth.userstate');

    /**
     * 消息
     */
    // 消息页数据
    Route::get('/massages/info', [MessagesController::class, 'getMessages']);
    // 通知详情页数据
    Route::get('/massages/getDetailsMessages', [MessagesController::class, 'getDetailsMessages']);

    // 已读对应类通知
    Route::get('/massages/readMessages', [MessagesController::class, 'readMessages']);
    // 发起聊天
    Route::post('/massages/addChat', [ChatController::class, 'addChat'])->middleware('auth.userstate');
    // 查询用户聊天记录
    Route::get('/massages/getUserChat', [ChatController::class, 'getUserChat']);
    // 已读对应用户信息
    Route::get('/massages/readUserChat', [ChatController::class, 'readUserChat']);
    // 用户删除聊天记录
    Route::get('/massages/userDelMessage', [ChatController::class, 'userDelMessage'])->middleware('auth.userstate');

    /**
     * 用户
     */
    // 更新用户资料
    Route::post('/user/update/info', [UserController::class, 'updateInfo'])->middleware('auth.userstate');
    // 关注
    Route::post('/user/follow', [PostsController::class, 'followUser'])->middleware('auth.userstate');
    // 拉黑
    Route::post('/user/black', [UserController::class, 'black'])->middleware('auth.userstate');
    // 举报
    Route::post('/user/report', [UserController::class, 'report'])->middleware('auth.userstate');

    // 反馈
    Route::post('/feedback/add', [FeedbackController::class, 'addFeedback'])->middleware('auth.userstate');
    // 我的反馈
    Route::get('/feedback/feedbacked', [FeedbackController::class, 'feedbacked']);
    // 是否解决
    Route::post('/feedback/resolve', [FeedbackController::class, 'resolve']);
    // 用户订单信息
    Route::get('/user/myOrder', [UserController::class, 'myOrder']);


    // 用户收益-可废除
    Route::get('/user/myFinancial', [UserController::class, 'myFinancial']);
    // 收益排行榜-待废除
    Route::get('/user/earnings/rank', [UserController::class, 'earningsRank']);
    // 用户发起提现-可废除
    Route::post('/user/initiateWithdrawal', [UserController::class, 'initiateWithdrawal'])->middleware('auth.userstate');
    // 用户提现记录-待废除
    Route::get('/user/myUserWithdrawal', [UserController::class, 'myUserWithdrawal']);
    // 用户收益记录-待废除
    Route::get('/user/myUserExceptional', [UserController::class, 'myUserExceptional']);
    // 用户余额记录-待废除
    Route::get('/user/financialRecord', [UserController::class, 'myUserFinancialRecord']);
    // 用户浏览记录-待废除
    Route::get('/user/myVisit', [UserController::class, 'myVisit']);
    // 用户金币记录-待废除
    Route::get('/user/coinsRecord', [UserController::class, 'myUserCoinsRecord']);
    // 提现相关API全部使用这个
    Route::any('/user/financial/process', [UserController::class, 'financial_process']);


    // 免费领会员
//    Route::get('/user/freeGetVip', [UserController::class, 'freeGetVip']);
    // 用户删除搜索记录
    Route::get('/user/myDelSearch', [CommonController::class, 'myDelSearch']);
    // 用户删除全部搜索记录
    Route::get('/user/myDelAllSearch', [CommonController::class, 'myDelAllSearch']);
    // 用户投票
    Route::post('/user/vote', [UserController::class, 'vote'])->middleware('auth.userstate');
    // 获取用户信息
    Route::get('/user/info', [UserController::class, 'userInfo']);
    // 用户绑定手机号
    Route::post('/user/bind/phone', [UserController::class, 'phone'])->middleware('auth.userstate');

    Route::post('/user/avatar_frame/wear', [UserController::class, 'avatar_frame_wear'])->middleware('auth.userstate');
    // 邀请兑换会员
    Route::post('/user/invite_member', [UserController::class, 'invite_member'])->middleware('auth.userstate');

    Route::get('/user/uploaded/unused-attachments', [UserController::class, 'uploaded_unused_attachments'])->middleware('auth.userstate');
    /**
     * 笔记
     */
    // 发帖时推荐的话题
    Route::get('/tags/recommend', [PostsController::class, 'recommendTags']);
    // 发帖时添加话题
    Route::post('/tags/add', [PostsController::class, 'addTag'])->middleware('auth.userstate');
    // 发帖 todo：待删除
    Route::post('/post/add', [PostsController::class, 'addPost'])->middleware('auth.userstate');
    // 用户关注圈子
    Route::post('/user/follow/circle', [CircleController::class, 'followCircle'])->middleware('auth.userstate');
    // 点赞 todo：待删除
    Route::post('/posts/like', [PostsController::class, 'like'])->middleware('auth.userstate');
    // 收藏collect todo：待删除
    Route::post('/posts/collect', [PostsController::class, 'collect'])->middleware('auth.userstate');
    // 图片不适 todo：待删除
    Route::post('/posts/blur', [PostsController::class, 'blur'])->middleware('auth.userstate');
    // 移动圈子 todo：待删除
    Route::post('/posts/move', [PostsController::class, 'move'])->middleware('auth.userstate');
    // 笔记审核 todo：待删除
    Route::post('/posts/examine', [PostsController::class, 'examine'])->middleware('auth.userstate');
    // 置顶 todo：待删除
    Route::post('/posts/sticky', [PostsController::class, 'sticky'])->middleware('auth.userstate');
    // 删除 todo：待删除
    Route::post('/posts/delete', [PostsController::class, 'deletePosts'])->middleware('auth.userstate');

    // 统一接口
    Route::any('/posts/process', [PostsController::class, 'posts_process'])->middleware('auth.userstate');

    // 帖子分享
    Route::post('/posts/feedback', [PostsController::class, 'feedback']);
    // 帖子分享
    Route::get('/posts/user/black', [PostsController::class, 'userBlack']);
    // 笔记付费推广
    Route::any('/posts/promotion', [PostsController::class, 'promotion']);
    // 添加评论
    Route::post('/comment/add', [CommentController::class, 'add'])->middleware('auth.userstate');
    // 点赞评论
    Route::post('/comment/like/add', [CommentController::class, 'commentAddLike'])->middleware('auth.userstate');
    // 用户认证
    Route::post('/user/authentication', [UserController::class, 'authentication'])->middleware('auth.userstate');
    // 学生认证
    Route::post('/user/student/certify', [StudentController::class, 'student_certify'])->middleware('auth.userstate');
    // 购买付费
    Route::post('/posts/pay', [PostsController::class, 'pay'])->middleware('auth.userstate');
    // 我的认证信息
    Route::get('/user/authentication', [UserController::class, 'getAuthentication']);
    // 我创建的圈子列表
    Route::get('/user/cricle', [UserController::class, 'myCircle']);
    // 我关注的用户列表
    Route::get('/user/followUser', [UserController::class, 'myFollowUsers']);
    // 我的粉丝用户列表
    Route::get('/user/fansUser', [UserController::class, 'myFansUsers']);
    // 获取用户列表
    Route::get('/user/users', [UserController::class, 'getUsers']);
    // 艾特搜索
    Route::get('/user/aite/search', [UserController::class, 'aiteSearch'])->middleware('auth.userstate');
    // 账号申请注销
    Route::post('/user/logoff', [UserController::class, 'logoff'])->middleware('auth.userstate');
    // 手机号绑定-发送验证码
    Route::any('/user/phone/bind', [UserController::class, 'user_phone_bind']);
    // 手机号权限-发送验证码-权限验证
    Route::post('/user/phone/send', [UserController::class, 'user_phone_send']);
    Route::post('/user/email/send', [UserController::class, 'user_email_send']);
    // 删除评论
    Route::post('/comment/delete', [CommentController::class, 'delComment'])->middleware('auth.userstate');
    // 置顶评论
    Route::post('/comment/sticky', [CommentController::class, 'stickyComment'])->middleware('auth.userstate');


    // 添加用户板块
    Route::post('/user/plate/add', [UserController::class, 'addUserPlate'])->middleware('auth.userstate');
    // 删除用户板块
    Route::post('/user/plate/delete', [UserController::class, 'deleteUserPlate'])->middleware('auth.userstate');
    Route::any('/user/real_name', [UserController::class, 'real_name']);
    // 审核通过圈子
    Route::post('/user/auditPosts', [PostsController::class, 'auditPosts'])->middleware('auth.userstate');
    // 用户关注的圈子文章列表
    Route::get('/user/follow/CircleList', [CircleController::class, 'userFollowCircleList']);

    /**
     * SHOP
     */
    //新建店铺
    Route::post('/shop/add', [ShopController::class, 'add']);
    // 经营地址
    Route::post('/shop/contact/process', [ShopController::class, 'contact_process']);
    // 关注店铺
    Route::post('/shop/follow', [ShopController::class, 'follow']);
    //添加购物袋
    Route::post('/shop/addCart', [ShopController::class, 'addCart']);
    //用户购物袋列表
    Route::get('/shop/userCartList', [ShopController::class, 'userCartList']);
    //修改购物袋商品数量
    Route::get('/shop/saveCartNum', [ShopController::class, 'saveCartNum']);
    //选中购物袋商品
    Route::get('/shop/checkCartGoods', [ShopController::class, 'checkCartGoods']);
    //全选购物袋商品
    Route::get('/shop/allCheckCartGoods', [ShopController::class, 'allCheckCartGoods']);
    //删除购物袋商品
    Route::get('/shop/delCartGoods', [ShopController::class, 'delCartGoods']);
    //用户默认地址
    Route::get('/shop/getCheckAdds', [ShopController::class, 'getCheckAdds']);
    //用户地址列表
    Route::get('/shop/getAddsList', [ShopController::class, 'getAddsList']);
    //增加/修改地址
    Route::post('/shop/saveAdds', [ShopController::class, 'saveAdds']);
    //删除地址
    Route::get('/shop/delAdds', [ShopController::class, 'delAdds']);
    //修改订单地址
    Route::post('/shop/orderAddress', [ShopController::class, 'orderAddress']);
    //下单商品列表
    Route::get('/shop/pliceOrderGoods', [ShopController::class, 'pliceOrderGoods']);
    //SHOP PAY 下单
    Route::post('/shop/order', [ShopOrderController::class, 'order']);
    //SHOP 订单列表
    Route::get('/shop/getOrderList', [ShopOrderController::class, 'getOrderList']);
    //SHOP 删除订单
    Route::get('/shop/delOrder', [ShopOrderController::class, 'delOrder']);
    //SHOP 取消订单
    Route::get('/shop/cancelOrder', [ShopOrderController::class, 'cancelOrder']);
    //SHOP 重新付款
    Route::post('/shop/payment', [ShopOrderController::class, 'payment']);
    //SHOP 催发货
    Route::post('/shop/pushDelivery', [ShopOrderController::class, 'pushDelivery']);
    //SHOP 发货
    Route::post('/shop/deliver', [ShopOrderController::class, 'deliver']);
    //SHOP 确认收货
    Route::get('/shop/confirmReceipt', [ShopOrderController::class, 'confirmReceipt']);
    //SHOP 申请退款
    Route::post('/shop/orderRefund', [ShopOrderController::class, 'orderRefund']);
    //SHOP 扫码劵
    Route::post('/shop/orderCoupon', [ShopOrderController::class, 'orderCoupon']);
    //SHOP 退货退款
    Route::post('/shop/refundGoods', [ShopOrderController::class, 'refundGoods']);
    Route::post('/shop/order_process', [ShopOrderController::class, 'shop_order_process']);


    //SHOP 查看物流
    Route::get('/shop/kuaidi', [ShopOrderController::class, 'kuaidi']);
    //SHOP 订单列表Count
    Route::get('/shop/getOrderCount', [ShopOrderController::class, 'getOrderCount']);
    //SHOP 用户购物袋数量
    Route::get('/shop/userCartCount', [ShopController::class, 'userCartCount']);
    //SHOP 淘客解析
    Route::post('/shop/taoke/parse', [ShopController::class, 'taokeParseUrl']);
    // 订单
    Route::post('/order', [OrderController::class, 'order']);
    // 余额支付
    Route::post('/balance_pay', [OrderController::class, 'balance_pay']);
    // 金币支付
    Route::post('/coin_pay', [OrderController::class, 'coin_pay']);

    /**
     * 图集
     */
    //图集
    Route::get('/wallpaper/wallpaper_process', [WallpaperController::class, 'wallpaper_process']);
    Route::post('/wallpaper/comment/process', [WallpaperController::class, 'comment_process']);
    /**
     * 闲置
     */
    Route::post('/used/good/add', [UsedController::class, 'add']);
    Route::post('/used/good/status', [UsedController::class, 'status']);
    Route::post('/used/good/need', [UsedController::class, 'need']);
    Route::post('/used/comment/process', [UsedController::class, 'comment_process']);
    /**
     * 选票
     */
    Route::post('/voter/process', [VoterController::class, 'voter_process']);
    /**
     * 组局
     */
    Route::post('/bureau/process', [BureauController::class, 'bureau_process']);
    Route::post('/bureau/comment/process', [BureauController::class, 'comment_process']);
    /**
     * 宠物
     */
    Route::post('/pets/adoption/add', [PetsController::class, 'adoption_add']);
    Route::post('/pets/adoption/apply', [PetsController::class, 'adoption_apply']);
    Route::post('/pets/adoption/collect', [PetsController::class, 'adoption_collect']);
    Route::post('/pets/adoption/apply/action', [PetsController::class, 'adoption_apply_action']);
    Route::post('/pets/comment/process', [PetsController::class, 'comment_process']);

    // 抽奖转盘
    Route::get('/luckdraw/info', [LuckDrawController::class, 'getLuckDrawInfo']);
    //抽奖
    Route::post('/user/luckdraw', [LuckDrawController::class, 'userLuckDraw'])->middleware('auth.userstate');
    //签到
    Route::post('/user/sign', [SignTaskController::class, 'sign'])->middleware('auth.userstate');
    // 领取任务奖励
    Route::post('/user/task/complete', [SignTaskController::class, 'taskReward'])->middleware('auth.userstate');
    // 签到任务页面数据
    Route::get('/signtask', [SignTaskController::class, 'sign_task_data']);
    // 任务大厅
    Route::get('/task/hall', [SignTaskController::class, 'task_hall']);

    /**
     * 移动端仪表盘
     */
    // 移动端仪表盘
    Route::get('/admin/dashboard', [AdminController::class, 'get_dashboard_data']);
    Route::get('/admin/imgs', [AdminController::class, 'imgs']);
    Route::post('/admin/setting', [AdminController::class, 'setting']);
    Route::post('/admin/circle/setting', [AdminController::class, 'circle_setting']);
    Route::post('/admin/attachment/delete', [AdminController::class, 'delete_attachment']);
});
/**
 * 需要登录
 * app专有接口
 */
Route::group(
    ['prefix' => 'v1/app', 'namespace' => 'Api', 'middleware' => 'auth.api'], function () {
    //SHOP PAY 下单
    Route::post('/shop/order', [ShopOrderController::class, 'orderForApp']);
    //SHOP 重新付款
    Route::post('/shop/payment', [ShopOrderController::class, 'paymentForApp']);
    // 开通会员，充电
    Route::post('/order', [OrderController::class, 'orderForApp']);
    // 苹果支付通知
    Route::post('/apple/notify/app', [NotifyController::class, 'apple_app']);
});
/**
 * 不需要登录
 * app专有接口
 */
Route::group(
    ['prefix' => 'v1/app', 'namespace' => 'Api', 'middleware' => 'auth.api2'], function ($app) {
    // 版本更新
    Route::get('/update', [CommonController::class, 'appUpdate']);
    // 版本更新
    Route::get('/guide', [CommonController::class, 'guide']);
    // 测试
    Route::post('/token/{uid}', function ($uid){
        if(env('APP_DEBUG')){
//            return JwtAuth::getToken('uid', $uid);
        }
    });

    // 后端获取用户资料进行注册
    Route::post('/login/code', [UserController::class, 'loginAppCode']);
    Route::post('/login/apple', [UserController::class, 'loginApple']);
    Route::post('/login/qq', [UserController::class, 'loginQQ']);

    // 商品海报
    Route::get('/shop/goods/poster', [ShopGoodsController::class, 'poster']);
    Route::get('/circle/poster', [CircleController::class, 'poster']);
    Route::get('/user/poster', [UserController::class, 'poster']);
});

/**
 * 不需要登录
 */
Route::group(
    ['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth.api2'], function ($app) {
    // 测试
    Route::get('/test', [IndexController::class, 'test']);
    // 登录
    Route::post('/login', [UserController::class, 'login']);
    // 发送验证码
    Route::post('/login/phone/code', [UserController::class, 'phone_code']);
    // 登录
    Route::post('/login/phone', [UserController::class, 'phone_login']);
    // 扫码登录
    Route::any('/login/scan', [UserController::class, 'scan']);
    // 板块列表
    Route::get('/posts/plate/list', [PostsController::class, 'plateList']);
    // 通过板块获取圈子
    Route::get('/posts/circle/byplateid', [PostsController::class, 'getCircleByPlateId']);
    // 轮播图
    Route::get('/circles/banner', [IndexController::class, 'circles_banner']);
    // 搜索圈子
    Route::get('/posts/circle/search', [PostsController::class, 'searchCircle']);
    // 推荐圈子
    Route::get('/circle/recommend', [CircleController::class, 'recommendCircle']);
    // 热门圈子
    Route::get('/circle/hot', [CircleController::class, 'hotCircle']);
    // 最新圈子
    Route::get('/circle/new', [CircleController::class, 'newCircle']);
    // 全部圈子
    Route::get('/circle/list', [CircleController::class, 'list']);
    // tab最近访问和关注的圈子
    Route::get('/circle/nearlyAndfollow', [CircleController::class, 'nearlyAndfollow']);
    // 圈子文章组合
    Route::get('/circle/circleAndPosts', [CircleController::class, 'circleAndPosts']);
    // 首页搜索
    Route::get('/index/search', [CommonController::class, 'search']);
    // 获取首页文章列表
    Route::get('/index/posts', [IndexController::class, 'getPosts']);
    // 获取笔记详情
    Route::get('/posts/detail', [PostsController::class, 'postsDetail']);
    // 获取相关笔记
    Route::get('/posts/relevant', [PostsController::class, 'postsRelevant']);
    // 获取视频笔记
    Route::get('/posts/video', [PostsController::class, 'recommendedVideos']);
    // 抖音视频
    Route::get('/posts/video/slide', [PostsController::class, 'videoSlide']);
    // 获取圈子详细
    Route::get('/circle/info', [CircleController::class, 'getCircleInfoById']);
    // 通过圈子id获取
    Route::get('/posts/byCircleId', [PostsController::class, 'postsByCircle']);
    // 搜索数量
    Route::get('/search/count', [CommonController::class, 'searcheCountJson']);
    // 热门搜索关键字列表
    Route::get('/search/hot/list', [CommonController::class, 'hotSearch']);
    // 首页轮播搜索关键字列表
    Route::get('/search/carousel/list', [CommonController::class, 'HomeCarousel']);
    // 通过笔记ID获取评论列表
    Route::get('/comment/byPostsId', [CommentController::class, 'getCommentByPostsId']);
    // 通过评论ID获取回复
    Route::get('/comment/byCommentId', [CommentController::class, 'getCommentByCommentId']);
    // 话题信息
    Route::get('/tags/info', [TagsController::class, 'tagInfo']);
    // 获取热门话题
    Route::get('/tags/hot', [TagsController::class, 'hotTags']);
    // 根据话题获取笔记列表
    Route::get('/posts/tags', [PostsController::class, 'listByTagId']);
    // 根据话题获取笔记列表
    Route::get('/posts/tagsv2', [PostsController::class, 'listByTagIdV2']);
    // 用户板块列表
    Route::get('/user/plate', [UserController::class, 'userPlate']);
    // 个人中心文章统计
    Route::get('/user/totalPost', [UserController::class, 'totalPost']);
    // 通过用户id获取用户信息
    Route::get('/user/info/byUserId', [UserController::class, 'userInfoByUserId']);
    // 查询用户聊天记录列表
    Route::get('/massages/getUserChatList', [MessagesController::class, 'getUserChatList']);
    // chat: 仅代表聊天 message：包含聊天，通知
    Route::any('/massages/process', [ChatController::class, 'massages_process']);
    // 我的笔记列表
    Route::get('/user/posts', [UserController::class, 'getMyPosts']);
    // 用户客户端信息
    Route::any('/user/system/info', [UserController::class, 'userSystemInfo']);

    Route::any('/user/process', [UserController::class, 'user_process']);


    // 获取活动列表
    Route::get('/common/activity', [CommonController::class, 'getActivityList']);
    // 获取条款
    Route::get('/common/getClauseDetail', [CommonController::class, 'getClauseDetail']);
    // 获取说明页面
    Route::get('/common/getHelp', [CommonController::class, 'getHelp']);
    Route::get('/common/getIcon', [CommonController::class, 'getIcon']);

    Route::any('/common/getUrlLink', [CommonController::class, 'getUrlLink']);

    // 帖子分享
    Route::get('/posts/share', [PostsController::class, 'share']);
    // 获取分享海报
    Route::get('/posts/makeShowQcode', [PostsController::class, 'makeShowQcode']);
    // 获取配置
    Route::get('/configData', [CommonController::class, 'configData']);
    // 查询用户是否有未读信息
    Route::get('/massages/getSysMessageCount', [MessagesController::class, 'getSysMessageCount']);
    // 查询笔记充电信息
    Route::get('/posts/getExceptionalList', [PostsController::class, 'getExceptionalList']);
    // 用户搜索列表
    Route::get('/search/my/list', [CommonController::class, 'mySearch']);
    // 板块选择列表
    Route::get('/posts/plate/options', [PostsController::class, 'plateOptions']);
    // 关注圈子用户列表
    Route::get('/circle/getCircleUserList', [CircleController::class, 'getCircleUserList']);

    //SHOP
    //店铺信息
    Route::get('/shop/info', [ShopController::class, 'info']);
    //保证金记录
    Route::get('/shop/guarantee/record', [ShopController::class, 'guarantee_record']);
    //banner图
    Route::get('/shop/bannerAndNav', [ShopController::class, 'bannerAndNav']);
    //通知详情
    Route::get('/shop/noticeDetail', [ShopController::class, 'noticeDetail']);
    //分类
    Route::get('/shop/classify', [ShopController::class, 'classify']);
    //首页推荐
    Route::get('/shop/indexRecommend', [ShopController::class, 'indexRecommend']);
    //商品详情
    Route::get('/shop/goodsDetails', [ShopController::class, 'goodsDetails']);
    //首页灵感推荐
    Route::get('/shop/inspiration', [ShopController::class, 'inspiration']);
    //首页热榜推荐
    Route::get('/shop/hotList', [ShopController::class, 'hotList']);
    //首页板块推荐
    Route::get('/shop/plate', [ShopController::class, 'plate']);
    //分类查询商品
    Route::get('/shop/classifyGoodsList', [ShopController::class, 'classifyGoodsList']);
    //搜索商品
    Route::get('/shop/goodsSearch', [ShopController::class, 'goodsSearch']);
    //商品晒单
    Route::get('/shop/goodsPosts', [ShopController::class, 'goodsPosts']);
    //商品晒单列表
    Route::get('/shop/goodsPostsList', [ShopController::class, 'goodsPostsList']);


    // 闲置
    Route::any('/used/process', [UsedController::class, 'process']);
    Route::get('/used/good/detail', [UsedController::class, 'detail']);
    Route::any('/used/good/list', [UsedController::class, 'list']);
    Route::get('/used/comment/list', [UsedController::class, 'comment_list']);
    Route::get('/used/classify/list', [UsedController::class, 'classify_list']);


    // 选票 todo:
    Route::get('/voter/template/list', [VoterController::class, 'template_list']);
    Route::get('/voter/template/info', [VoterController::class, 'template_info']);
    Route::get('/voter/list', [VoterController::class, 'list']);
    Route::get('/voter/detail', [VoterController::class, 'detail']);
    Route::get('/voter/player/list', [VoterController::class, 'player_list']);
    Route::get('/voter/player/detail', [VoterController::class, 'player_detail']);


    // 组局
    Route::get('/bureau/list', [BureauController::class, 'bureau_list']);
    Route::get('/bureau/comment/list', [BureauController::class, 'comment_list']);
    Route::get('/bureau/detail', [BureauController::class, 'detail']);
    Route::get('/club/info', [BureauController::class, 'club_info']);

    // 纸条
    Route::get('/note/list', [NoteController::class, 'list']);

    // 学生系统
    Route::get('/student/user/courses', [StudentController::class, 'user_courses']);



    // 图集
    // 获取图集详情
    Route::get('/wallpaper/detail', [WallpaperController::class, 'detail']);
    Route::get('/wallpaper/list', [WallpaperController::class, 'list']);
    Route::get('/wallpaper/comment/list', [WallpaperController::class, 'comment_list']);
    /**
     * 宠物
     */
    Route::get('/pets/adoption/config', [PetsController::class, 'adoption_config']);
    Route::get('/pets/adoption/list', [PetsController::class, 'adoption_list']);
    Route::get('/pets/adoption/detail', [PetsController::class, 'adoption_detail']);
    Route::get('/pets/comment/list', [PetsController::class, 'comment_list']);


    Route::get('/help/questions', [HelpController::class, 'questions']);
    Route::get('/help/detail', [HelpController::class, 'detail']);


    Route::get('/page/tabs', [PageController::class, 'tabs']);
    Route::get('/page/menus', [PageController::class, 'menus']);
    Route::get('/page/qrcodes', [PageController::class, 'qrcodes']);

    Route::get('/interval/mplogin', [UserController::class, 'mplogin']);

    // 热帖榜
    Route::get('/realtime/top/posts', [CommonController::class, 'realtime_post']);

    // 热门
    Route::get('/realtime/top/topics', [CommonController::class, 'realtime_topics']);

    // 我的名片
    Route::get('/user/codecard', [UserController::class, 'codecard']);
    Route::get('/user/paycode', [UserController::class, 'paycode']);
    Route::get('/user/membersdata', [UserController::class, 'membersdata']);

    // 地址
    Route::post('/geocode/regeo', [LocationController::class, 'geocode_regeo']);

    Route::get('/user/invite/info', [UserController::class, 'invite_info']);
    Route::get('/user/invite/list', [UserController::class, 'invite_list']);

    Route::get('/user/reward_gift', [UserController::class, 'reward_gift']);

    Route::post('/common/putlog', [CommonController::class, 'putLog']);


    Route::post('/common/tenants', [CommonController::class, 'tenants']);

    Route::get('/common/express_range', [CommonController::class, 'express_range']);

    Route::get('/common/idd', [CommonController::class, 'idd']);

    Route::get('/common/university', [CommonController::class, 'university']);

    Route::post('/common/captcha/process', [CommonController::class, 'captcha_process']);

    Route::any('/aggregate/config', [AggregateController::class, 'config']);

    // 对用户的操作聚合
    Route::any('/aggregate/user/hanlder', [AggregateController::class, 'user_hanlder']);

});


/**
 * 不需要登录
 * 采用固定码访问
 */
Route::group(
    ['prefix' => 'v1/admin', 'namespace' => 'Api', 'middleware' => 'auth.code'], function () {
    Route::post('/common/map', [AdminCommonController::class, 'map']);
    Route::post('/posts/create', [AdminPostsController::class, 'create']);
    Route::post('/posts/delete', [AdminPostsController::class, 'delete']);
    Route::post('/posts/update', [AdminPostsController::class, 'update']);
    Route::post('/comment/create', [AdminCommentController::class, 'create']);
    Route::post('/comment/delete', [AdminCommentController::class, 'delete']);
    Route::post('/comment/update', [AdminCommentController::class, 'update']);
    Route::post('/goods/create', [AdminGoodsController::class, 'create']);
    Route::post('/goods/delete', [AdminGoodsController::class, 'delete']);
    Route::post('/goods/update', [AdminGoodsController::class, 'update']);
    Route::post('/task/actions', [AdminActionsController::class, 'batch']);
    Route::post('/task/actions/user', [AdminActionsController::class, 'user']);
});

Route::group(
    ['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth.api3'], function ($app) {
    //微信预拉取
    Route::any('/fetch/pre', [CommonController::class, 'backgroundFetchPre']);
    // 微信12小时 周期性拉取
    Route::any('/fetch/period', [CommonController::class, 'backgroundFetchPeriod']);
});

Route::group(
    ['prefix' => 'v1', 'namespace' => 'Api'], function ($app) {
    // 支付通知
    Route::any('/notify', [NotifyController::class, 'index']);
    Route::any('/wechat/mp/event', [WeChatController::class, 'mp_event_handler']);
    Route::any('/wechat/mini/event', [WeChatController::class, 'mini_event_handler']);
    Route::any('/cos/review/callback', [ApiController::class, 'cos_review_callback']);

});

Route::group(
    ['prefix' => 'v1/app', 'namespace' => 'Api'], function ($app) {
    // 支付状态

    Route::post('/pay/status', [OrderController::class, 'orderAppCommonStatus']);

    // h5支付，返回的url
    Route::get('/pay/direct/{out_trade_no}', function ($out_trade_no){
        return Utils::payDirectHtmlForApp($out_trade_no);
    })->name('pay.direct');

    // h5支付，返回的url
    Route::get('/pay/return/{out_trade_no}', function ($out_trade_no){
        return Utils::payDirectHtmlForApp($out_trade_no, '', true);
    })->name('pay.return');

    // 支付通知
    Route::any('/ali/notify/wap', [NotifyController::class, 'alipay_wap']);
    Route::any('/ali/notify/app', [NotifyController::class, 'alipay_app']);
    // 支付通知
    Route::any('/wechat/notify', [NotifyController::class, 'wechat_app']);
    // 支付通知
    Route::any('/yi/notify', [NotifyController::class, 'yi_app']);

    // 域名授权
    Route::any('/app/center/login', [DomainAuthController::class, 'app_center_login']);

});

Route::group(
    ['prefix' => 'v1/three', 'namespace' => 'Api', 'middleware' => 'auth.api3'], function ($app) {
    Route::get('/system/info', [ThirdPartyController::class, 'system_info']);
    Route::post('/search_menu', [ThirdPartyController::class, 'search_menu']);
    Route::any('/push/posts', [ThirdPartyController::class, 'push_post']);
    Route::post('/domain/auth', [ThirdPartyController::class, 'domain_auth']);

    Route::get('/version', [ThirdPartyController::class, 'version']);

    Route::post('/license', [ThirdPartyController::class, 'license'])->middleware('auth.api');
});


// 提供需要检验access_token的外部服务
Route::group(
    ['prefix' => 'v1/three/safe', 'namespace' => 'Api', 'middleware' => 'access.token'], function ($app) {
    Route::post('/w', [ThirdPartyController::class, 'mr_wen']);
    Route::post('/encode', [ThirdPartyController::class, 'mini_encode']);
    Route::post('/user/info_login', [ThirdPartyController::class, 'user_info_login']);
    Route::post('/notice', [ThirdPartyController::class, 'notice']);
    Route::post('/user/balance', [ThirdPartyController::class, 'user_balance']);
    Route::post('/user/coin', [ThirdPartyController::class, 'user_coin']);
    Route::any('/collecter/posts/add', [ThirdPartyController::class, 'collecter_posts_add']);
    Route::get('/templete/message/add', [ThirdPartyController::class, 'templete_message_add']);
});